/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.adcc.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import vn.adcc.dao.CustomerDao;
import vn.adcc.model.Customer;
import vn.adcc.service.CustomerManager;

/**
 *
 * @author ducanh.nguyen
 */
@Service("customerManager")
public class CustomerManagerImpl extends GenericManagerImpl<Customer, Integer> implements CustomerManager {
    private CustomerDao customerDao;

    public List<Customer> getCustomers() {
        return customerDao.getAllDistinct();
    }

    public List<Customer> search(String query) {
        return super.search(query, Customer.class);
    }

    @Override
    public Customer save(Customer customer){
        return customerDao.save(customer);
    }

    /**
     * @param customerDao the customerDao to set
     */
    @Autowired
    public void setCustomerDao(CustomerDao customerDao) {
        this.customerDao = customerDao;
        // set dao object for parent class.
        this.dao = customerDao;
    }



}
